package org.loong.crypto.extension.cms;

import org.loong.crypto.common.exception.CryptoException;
import org.loong.crypto.service.CryptoService;
import org.loong.crypto.spi.SPI;

/**
 * The interface of encrypt the signature message syntax specification.
 */
@SPI
public interface CMSProvider {

    /**
     * Generate data.
     * 
     * @param cryptoService the cryptoService
     * @param params the params
     * @return the resulting data object
     * @throws CryptoException the {@link CryptoException}
     */
    byte[] generate(CryptoService cryptoService, CMSParameters params) throws CryptoException;
    
    /**
     * Parse data.
     * 
     * @param cryptoService the cryptoService
     * @param params the params
     * @return the resulting data object
     * @throws CryptoException the {@link CryptoException}
     */
    byte[] parse(CryptoService cryptoService, CMSParameters params) throws CryptoException;
}
